package com.stepshop.core.thread.jdk;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class JDKExecutor {
	public static int count=0;
	private static ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10000, 200, TimeUnit.MILLISECONDS,
			new ArrayBlockingQueue<Runnable>(5));
	public static void execute(Runnable run){
		executor.execute(run);
		System.out.println("线程池中线程数目：" + executor.getPoolSize() + "，队列中等待执行的任务数目：" + executor.getQueue().size()
				+ "，已执行完别的任务数目：" + executor.getCompletedTaskCount());
	}
	private JDKExecutor(){
	}
}
